Step-By-Step Debugging

To minimize risk, the KAS-IDE, in conjunction with the KAS Simulator, allows checking and validating the application program prior to deployment of the machine/system in production. This is achieved by capturing critical events in a Step-By-Step Debugging mode.

In addition to the cycle-by-cycle execution mode, the debugger has a collection of features for Step-By-Step Debugging in the source code of the application.


  • Step-By-Step Debugging is only available if the project has been compiled with the Debug option.
    This option is selected from the project compiling PLC options dialog box (accessed using the button).

Figure 1: PLC Options - Debug Compiling Mode

  • An application compiled in Debug mode includes additional information for stepping.
    • This leads to a larger code size and reduced performance.
  • When debugging is finished, it is recommended to compile the application in Release mode to give highest performance to the application.

Step-By-Step Debugging is available in:

  • FBD (a step is considered as a graphic symbol corresponding to an action).
  • FFLD programs (a step is considered as a rung).
  • ST and IL text programs (a step is considered as a statement).

  • Step-By-Step Debugging is not possible in SFC programs.
    See About SFC for more information.

These are the options for entering the Step-By-Step Debugging mode:

  • When a breakpoint is set in a program.
    • When you start your application and the breakpoint is reached, the execution stops at the specified location.
      You can run one step further in the program with the stepping commands.
  • When the target is in cycle stepping mode (STOP).
    • You can step to the beginning of the first program.

  • Pausing a program does not interrupt the current VM cycle.
    The current cycle finishes and execution is paused before the beginning of the next VM cycle.

These commands are available from the Debug toolbar for stepping:

Button Description

Step Over the next instruction:

If the next instruction is a call of a function block or a sub-program, the execution passes over to the following instruction.

Step Into the next instruction:
  • The next step is at the beginning of the called block.
  • If the next instruction is not a call of a function block or a sub-program, the Step Into behaves like the Step Over.

Step Out the current block:
  • If the current stepping position is in a called function block or a sub-program, the execution continues up to the end of the current block.
  • Otherwise, the Step Out behaves like the Step Over.

These commands are available at any time:

Button Description

Execute a cycle step (from the current position up to the end of the last program).

Restart the target in Normal execution mode (RUN).